using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Samples.SsbTransportChannel;
using System.ServiceModel;
using SsbTransportTestSuite.Proxies.OneWay;
using System.ServiceModel.Channels;

namespace SsbTransportTestSuite.Clients
{
    class TestOneWayClient
    {
        internal void RunClient(Binding binding)
        {
            OrderProcessingClient client = new OrderProcessingClient(binding,new EndpointAddress(TestUtils.ServiceEndpointAddress));
            Order order = new Order();
            order.OrderId = Guid.NewGuid();
            client.BeginOrder(order);
            OrderItem item1 = new OrderItem();
            item1.ItemDescription = "Widget 1";
            OrderItem item2 = new OrderItem();
            item2.ItemDescription = "Widget 2";
            client.AddOrderItem(item1);
            client.AddOrderItem(item2);
            
            client.EndOrder();
            client.Close();
        }

    }
}
